<?php
/**
 * Campain Search Result
 */
use Fox\Common\Customer\Type;
use Fox\Html\AnchorObject;
/*
global $typeLabel;
$typeLabel = array();
$finder = new Ty();
$types = $finder->find(new Fox\Dao\SqlFragment("language = ?",array(Xview::instance()->language())));
foreach($types as $type)
{
	$typeLabel[$type->type] = $type->label();
}
*/
$grid = new Fox\Grid("gResult");
$grid->fieldcat(array("label","uname","udate"));
$grid->fieldcat()->switchToObjectMode();
/*
 $grid->fieldcat()->setGenerators(array(
 'type' => Fox\Generator::useFunction(function ($data,$key){
 global $typeLabel;

 if(isset($typeLabel[$data->type]))
 return $typeLabel[$data->type];
 else
 return $data->type;

 })));
 */

$grid->setFieldAttr(array("label"),"setAnchor",
new AnchorObject("?mod=campains&act=update",array(
					'campainid' => Fox\Generator::useAttribute())
));
	
return $grid;